/*
 * ValidationException.java
 *
 * Copyright©2012 JMAS corporation. All rights reserved.
 */
package jp.co.jmas.jmasvideo.exception;

import java.util.Arrays;
import java.util.List;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

import jp.co.jmas.jmasvideo.dao.ErrorMessage;

@SuppressWarnings("serial")
public class ValidationException extends WebApplicationException {
	public ValidationException() {
		super(Status.BAD_REQUEST);
	}

	public ValidationException(List<ErrorMessage> messageList) {
		super(Response.status(Status.BAD_REQUEST).entity(messageList).type(MediaType.APPLICATION_JSON).build());
	}

	public ValidationException(ErrorMessage message) {
		this(Arrays.asList(message));
	}
}